package com.lighting.smssystem.configuration;

import com.github.qcloudsms.SmsMultiSender;
import com.github.qcloudsms.SmsSingleSender;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author leemaster
 * @Title: TencentConfiguration
 * @Package com.lighting.smssystem.configuration
 * @Description:
 * @date 2019-06-0416:20
 */
@Configuration
public class TencentConfiguration {

    @Value("${sms.tencent.sms.appid}")
    public String appid;

    @Value("${sms.tencent.sms.appkey}")
    public String appkey;


    @Bean
    public SmsSingleSender smsSingleSender(){
        SmsSingleSender sender = new SmsSingleSender(Integer.parseInt(appid),appkey);
        return sender;
    }

    @Bean
    public SmsMultiSender smsMultiSender(){
        SmsMultiSender sender = new SmsMultiSender(Integer.parseInt(appid),appkey);
        return sender;
    }
}
